package com.example.win.android_banduyujia.peopleactivity.fragment.materfragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import com.example.win.android_banduyujia.R;
import com.example.win.android_banduyujia.peopleactivity.activity.activity.CertActivity;
import com.example.win.android_banduyujia.peopleactivity.activity.activity.openactivity.DataActivity.DataActivity;
import com.example.win.android_banduyujia.peopleactivity.activity.activity.HonorActivity;
import com.example.win.android_banduyujia.peopleactivity.activity.activity.RealActivity;

/**
 * Created by huchun on 2015/8/15.
 */
public class EditFragment extends Fragment implements View.OnClickListener {
    private static final String TAG = EditFragment.class.getSimpleName();

    private TextView  mTvtData, mTvtReName,mTvtCer, mTvtLet;
    private Button    mBtnSub;

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          View view = inflater.inflate(R.layout.fragment_submit_audit, null);

        InitViews(view);

        return view;
    }

    private void InitViews(View view) {
        mTvtData = (TextView) view.findViewById(R.id.submit_title_list_item_photo);
        mTvtReName = (TextView) view.findViewById(R.id.submit_title_list_item_real_name);
        mTvtCer = (TextView) view.findViewById(R.id.submit_title_list_item_certification_certificate);
        mTvtLet = (TextView) view.findViewById(R.id.submit_title_list_item_letter_credit);
        mBtnSub = (Button) view.findViewById(R.id.layout_button_data_submit_audit);

        mTvtData.setOnClickListener(this);
        mTvtReName.setOnClickListener(this);
        mTvtCer.setOnClickListener(this);
        mTvtLet.setOnClickListener(this);
        mBtnSub.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.submit_title_list_item_photo: // 基本资料
                 BaceActivity();
                break;
            case R.id.submit_title_list_item_real_name: // 实名认证
                 RealActivity();
                break;
            case R.id.submit_title_list_item_certification_certificate: // 认证证书
                 CerActivity();
                break;
            case R.id.submit_title_list_item_letter_credit: // 荣誉证
                 LetActivity();
                break;
            case R.id.layout_button_data_submit_audit: // 提交审核
                 SubActivity();
                break;
        }
    }

    private void BaceActivity() {
        startActivity(new Intent(getActivity(), DataActivity.class));
    }

    private void RealActivity() {
         startActivity(new Intent(getActivity(), RealActivity.class));
    }

    private void CerActivity() {
        startActivity(new Intent(getActivity(), CertActivity.class));
    }

    private void LetActivity() {
         startActivity(new Intent(getActivity(), HonorActivity.class));
    }

    private void SubActivity() {

    }
}
